<template>
    <el-row style="padding: 5px 0;">
        <el-col :span="4">
            <i class="iconfont icon-warning" style="color: #ffba00;font-size: 25px;"></i>
        </el-col>
        <el-col :span="20">此操作将永久删除该文件, 是否继续?</el-col>
    </el-row>
    <el-row :span="24" class="col" style="margin: 20px 0px;padding: 0 20px;">
        <el-col :span="5" :offset="16">
            <el-button type="default" @click="cancle">取消</el-button></el-col>
        <el-col :span="3">
            <el-button type="primary" @click="save">确定</el-button></el-col>
    </el-row>
</template>
<script setup>
import { defineEmits, defineProps } from 'vue';
import { ElMessage } from 'element-plus';
import axios from 'axios';
const emits = defineEmits(["operate"]);
let res = "";

let props = defineProps({
    id: {
        Required: true
    },
    caozhuo:{
        type:String
    }
})
console.log(props.id.id);


const cancle = function () {
    ElMessage("已取消删除");
    emits("operate");
}


const save = async function () {
    res = await axios.get("/api/article/del?id="+props.id.id)

    ElMessage({
        message: res.data.data,
        type: res.data.code == 200 ? "success" : "error"
    })
    emits("operate")
}


</script>
